package com.hoperun.checkcloth.ui

import android.widget.EditText
import android.widget.TextView
import androidx.databinding.BindingAdapter
import com.hoperun.checkcloth.R


@BindingAdapter("disableKeyboardPopup")
fun disableKeyboardPopUpOnEditText(editText: EditText, flag: Boolean) {
    editText.showSoftInputOnFocus = !flag
}

@BindingAdapter("flawText")
fun setFlawTypeText(textView: TextView, text: String) {
    if (text.isEmpty()) {
        textView.setBackgroundResource(0)
        textView.text = ""
    } else {
        textView.text = text
        textView.setBackgroundResource(R.drawable.btn_corner_gray)
    }
}